import {
  GETMOVIELIST
} from '../constants/movie_const'

const initState = {
  movieList: []
}

export default function movieReducer(pervState = initState, action) {
  const {
    type,
    data
  } = action
  switch (type) {
    case GETMOVIELIST:
      return {
        ...pervState,
        movieList: data
      };
    default:
      return pervState
  }
}